//
//  WBNavigationController.swift
//  XLWibo-Swift
//
//  Created by 王林 on 2016/11/12.
//  Copyright © 2016年 木木. All rights reserved.
//

import UIKit

class WBNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.

//        self.navigationBar.tintColor = UIColor.white
        
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        let count = childViewControllers.count
        
        if  count > 0{
            
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem.init(title: "返回", imgName: "navigationbar_back_withtext", font: 14,  target: self, action: #selector(clickBack))
            viewController.hidesBottomBarWhenPushed = true
        }
        
        super.pushViewController(viewController, animated: animated)
    }
    
    
    func clickBack(){
        self.popViewController(animated: true)
    }
    
}
